package com.har.modules.business.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.har.common.utils.PageUtils;
import com.har.common.utils.Query;
import com.har.modules.business.dao.TCompanyDao;
import com.har.modules.business.entity.TCompanyEntity;
import com.har.modules.business.service.TCompanyService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author macwy
 * @Title:har-finance
 * @Package com.har.modules.business.service.impl
 * @Description
 * @date 2018/7/18 15:48
 * @Version 1.0
 */

@Service("companyService")
public class TCompanyServiceImpl extends ServiceImpl<TCompanyDao,TCompanyEntity> implements TCompanyService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        EntityWrapper<TCompanyEntity> ew = new EntityWrapper<>();

        ew.orderBy("update_time",false);

        Page<TCompanyEntity> page = this.selectPage(
                new Query<TCompanyEntity>(params).getPage(),
                ew
        );

        return new PageUtils(page);
    }
}
